import { Next, Context } from 'koa'
import Topic from '../model/topics'

export default async function (ctx: Context, next: Next) {
  const topic = await Topic.findById(ctx.params.id)
  if (!topic) {
    ctx.throw(404, '话题不存在')
  }
  await next()
}
